<?php

if (eregi("header.php", $_SERVER['SCRIPT_NAME'])) {
    Header("Location: index.php");
    die();
}

@require_once("mainfile.php");

function head() {
    global $currentlang, $key_words, $header_page_keyword, $home, $ThemeSel, $page_title, $page_title2, $module_title, $sitename, $banners, $nukeurl, $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $adminpage, $pagetitle, $month;

    if($home == 1) $module_title = ""._HOMEPAGE."";
    include("".INCLUDE_PATH."themes/$ThemeSel/theme.php");
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    echo "<html>\n";
    echo "<head>\n";
//    echo "<meta http-equiv=\"content-type\" content=\"text/html; charset="._CHARSET."\">\n";
echo	"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
    echo "<meta http-equiv=\"expires\" content=\"0\">\n";
    $genhour = gmdate("H");
	if (intval($genhour) != "" && intval($genhour) != 0) $genhour = $genhour - 1;
	@Header("Last-Modified: ".gmdate("D, d M Y ".intval($genhour).":i:s")." GMT");
	@Header("Content-Type: text/html; charset="._CHARSET."");
    echo "<meta name=\"resource-type\" content=\"document\">\n";
    echo "<meta name=\"distribution\" content=\"global\">\n";
    echo "<meta name=\"author\" content=\"$sitename\">\n";
    echo "<meta name=\"copyright\" content=\"Copyright (c) ".gmdate("Y")." by $sitename\">\n";
    if (isset($key_words)) {
    $key_words = "".strip_tags($key_words).", ";
    }
    if (isset($header_page_keyword)) {
    $keywords = strip_tags($header_page_keyword);
    } else {
    	$keywords="";
    }
    $keywords = trim(ereg_replace('("|\?|!|:|\.|\(|\)|;|\\\\)+', ' ', $keywords));
    $keywords = ereg_replace('( |'.CHR(10).'|'.CHR(13).')+', ',', $keywords);
    $keywords = substr($keywords, 0, 1600);
    $keywords = array_unique(explode(",", $keywords));
    for($i=0; $i<count($keywords)-1; $i++) {
    if(strlen($keywords[$i]) > 3) { $key_words .= "$keywords[$i], "; }
    }
    $key_words .= "nukeviet, phpnuke, vietnam, cms, php, MySQL, antuongnet";
    echo "<meta name=\"keywords\" content=\"$key_words\">\n";
    if ($page_title == "") {
    echo "<meta name=\"description\" content=\"".strip_tags($sitename)."\">\n";
    }
    else {
    echo "<meta name=\"description\" content=\"$page_title\">\n";
    }
    echo "<meta name=\"robots\" content=\"index, follow\">\n";
    echo "<meta name=\"revisit-after\" content=\"1 days\">\n";
    echo "<meta name=\"rating\" content=\"general\">\n";
    echo "<title>$sitename";
    if($module_title!="") { echo " | $module_title"; }
    if($page_title!="") { echo " | $page_title"; }
    echo "</title>\n";
//    echo"<script language=\"JavaScript\">\n"
//  . "<!--\n"
//  . "function MM_openBrWindow(theURL,winName,features) { //v2.0\n"
//  . "  window.open(theURL,winName,features);\n"
//  . "}\n"
//  . "//-->\n"
//  . "</script>\n";

    echo"<script language=\"JavaScript\">\n"
      . "var sitelang = '".$currentlang."';\n"
      . "var siteroot = '".INCLUDE_PATH."';\n"
      . "</script>\n";
        echo "<script language=JavaScript src='".INCLUDE_PATH."js/js.js'></script>\n";

    echo "<link rel=\"StyleSheet\" href=\"".INCLUDE_PATH."themes/$ThemeSel/style/style.css\" type=\"text/css\">\n\n\n";

    echo "\n\n\n</head>\n\n";
    themeheader();
}

head();

global $home, $name;
if ($home == 1) {
    newsstart();
    message_box();
    blocks('Center',$name);
}

?>